﻿@namespace Microsoft.FluentUI.AspNetCore.Components
@inherits FluentInputBase<bool>
<fluent-switch @ref=Element
               class="@ClassValue"
               style="@StyleValue"
               readonly=@ReadOnly
               id=@Id
               disabled=@Disabled
               name=@Name
               aria-label="@(string.IsNullOrEmpty(AriaLabel) ? Label : AriaLabel)"
               required=@Required
               current-checked="@CurrentValue"
               @onswitchcheckedchange="@((e) => CurrentValue = e.Checked ?? false)"
               @attributes="@AdditionalAttributes">
    @Label
    @LabelTemplate
    @ChildContent
    @if (!string.IsNullOrEmpty(CheckedMessage))
    {
        <span slot="checked-message">@CheckedMessage</span>
    }
    @if (!string.IsNullOrEmpty(UncheckedMessage))
    {
        <span slot="unchecked-message">@UncheckedMessage</span>
    }
</fluent-switch>
